<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>redis秒杀</title>
</head>
<body>
<h3>访问成功</h3>
<h1>iPhone 13 Pro !!! 1元秒杀！！！
</h1>


<form id="msform" action="doseckill" enctype="application/x-www-form-urlencoded">
    <input type="hidden" id="prodid" name="prodid" value="0101">
    <input type="button" id="miaosha_btn" name="seckill_btn" value="秒杀点我"/>
</form>
</body>
<script  type="text/javascript" th:src="@{js/jquery-3.1.0.js}" src="js/jquery-3.1.0.js"></script>
<script  type="text/javascript">
    $(function(){
        $("#miaosha_btn").click(function(){
            var url=$("#msform").attr("action");
            $.post(url,$("#msform").serialize(),function(data){
                if(data==false){
                    alert("抢光了" );
                    $("#miaosha_btn").attr("disabled",true);
                }
            } );
        })
    })
</script>
</html>